package com.nb.provider.serviceimpl;

import com.nb.api.model.Product;
import com.nb.api.service.ProductServiceAPI;
import org.apache.dubbo.config.annotation.DubboService;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import java.math.BigDecimal;

@Path("/product")
@DubboService
public class ProductServiceApiImpl implements ProductServiceAPI {


    @GET
    @Path("/{id}")
    @Produces(MediaType.APPLICATION_JSON)
    @Override
    public Product getById(@PathParam("id") Integer id) {
        return Product.builder()
                .id(id)
                .name("小米手机-小米" + id)
                .price(new BigDecimal(999))
                .build();
    }
}
